package com.cjq.controller;


import com.cjq.pojo.Usersssm;
import com.cjq.service.UserService;
import com.cjq.vo.ResultVO;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@ResponseBody    //返回对象类型
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping(value = "deng",method = RequestMethod.GET)
    public ResultVO<Usersssm> loginUser(String loginname,String password){
        System.out.println(loginname+"ddd"+password);
        int i = userService.loginUser(loginname, password);
        if (i==1){
            return new ResultVO<>(200,"登录成功");
        }else {
            return new ResultVO<>(500,"登录失败");
        }

    }
}
